window.CUSTOMER_DATA_HUB_API_SERVER="https://hubapi.fromdoppler.com",window.POPUP_HUB_API_SERVER="https://apis.fromdoppler.com/doppler-popup-hub-msa/api",window.SCRAPING_API_SERVER="https://apis.fromdoppler.com/doppler-product-scraping",window.CDH_VERSION="v9.1.1",window.cdhReferrer=function(){var e;return e=window.cdh_stored_referrer||""===window.cdh_stored_referrer?window.cdh_stored_referrer:document.referrer,window.cdh_stored_referrer=window.location.href,e}();const enableCustomTracking=document.currentScript&&"true"==document.currentScript.getAttribute("enableCustomTracking"),domainsToBeLinked=document.currentScript&&document.currentScript.getAttribute("domainsToBeLinked");var _dha=function(){function e(e){var t;return void 0===(t="object"==typeof e[0]?e[0]:{}).local&&(t.local=!1),t}function t(e,t,r){return enableCustomTracking?{page:e||window.location.pathname,search:t,hash:r,referrer:window.cdhReferrer,host:window.location.host}:{page:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:window.cdhReferrer,host:window.location.host}}function r(e,t,r,n,o){_dha.pageInfo.getPageInformation(!1,null).then(i=>{_dha.proxy.trackData(_dha.storage.getItem("_dha__uuid"),window.location.host,e||window.location.pathname,n,t,r,_dha.utils.detectSourceByUrl(),"historychange_"+o,null,null,i,_dha.utils.hasEmail())})}function n(e){if(0!==e.button&&1!==e.button)return;const t=domainsToBeLinked&&domainsToBeLinked.split(",").map(function(e){return e.trim()});if(!t||0===t.length)return;const r=_dha.storage.getItem("_dha__em");if(r){const e=_dha.utils.asciiToHex(r),n={completeUrl:this.href,protocolHostAndPath:this.origin+this.pathname,search:this.search,hash:this.hash,host:this.host};-1!==t.indexOf(n.host)&&(this.href=_dha.utils.getUrlAddingNewParam(n,"dplrid",e))}}function o(e){if(!domainsToBeLinked||""===domainsToBeLinked.trim())return;const t=(e||document).getElementsByTagName("a"),r=t&&[].slice.call(t).filter(e=>e.href);[].forEach.call(r,function(e){e.addEventListener("click",n),e.addEventListener("auxclick",n)})}function i(e){const r=function(e){e.cdhFnOnChange&&e.removeEventListener("change",e.cdhFnOnChange),e.cdhFnOnChange=function(r){!function(e,r){if(_dha.utils.trackVisitorEmail(e.target.value)){const e=t(null,null,null);_dha.pageInfo.getPageInformation(!1,null).then(t=>{_dha.proxy.trackData(_dha.storage.getItem("_dha__uuid"),e.host,e.page,e.referrer,e.search,e.hash,"","inputemailchange",r.id,null,t,_dha.utils.hasEmail())})}}(r,e)},e.addEventListener("change",e.cdhFnOnChange)},n=(e||document).getElementsByTagName("input");[].forEach.call(n,function(e){("email"===e.type||e.id&&-1!==e.id.indexOf("email")||e.name&&-1!==e.name.indexOf("email"))&&r(e)})}return window.addEventListener("hashchange",function(e){if(!enableCustomTracking){var t=_dha.storage.getItem("_dha__uuid");t&&_dha.pageInfo.getPageInformation(!1,null).then(r=>{_dha.proxy.trackData(t,window.location.host,window.location.pathname,e.oldURL,window.location.search,window.location.hash,null,"hashchange",null,null,r,_dha.utils.hasEmail())})}}),{trackAddToCart:function(e){var t=e.formSelectors||[],r=_dha.pageInfoUtils.getTagsByNameAndAttribute("form",t),n=[];r&&r.length>=1&&r.forEach(function(e){var t=e.querySelector("input[type=submit], button[type=submit], button[type=button]");t&&n.push({form:e,input:t})}),n.forEach(function(e){e.input.addEventListener("click",function(){_dha.pageInfo.getPageInformation(!0,{involvedForm:e.form}).then(e=>{_dha.proxy.trackData(_dha.storage.getItem("_dha__uuid"),window.location.host,window.location.pathname,window.cdhReferrer,window.location.search,window.location.hash,_dha.utils.detectSourceByUrl(),"addcartformevent",null,null,e,_dha.utils.hasEmail())})})})},track:function(){var r=e(arguments);_dha.proxy.config(r);var n=_dha.storage.getItem("_dha__uuid"),o=_dha.utils.obtainEmailParameter(),i=function(e,t){var r=!1,n="";return e?(t&&e!==t?(n=t,_dha.storage.deleteItem("_dha__uuid"),_dha.storage.setItem("_dha__uuid",n),_dha.proxy.aliasVisitor(t,e)):n=e,{guid:n,isNewGuid:r}):(t?n=t:(n=_dha.utils.generateUUID(),r=!0),_dha.storage.setItem("_dha__uuid",n),{guid:n,isNewGuid:r})}(n,_dha.utils.getParameterByName("dha_id"));_dha.updateUrlLink(i.guid);const a=t(r.navigatedPage,r.search,r.hash);_dha.pageInfo.getPageInformation(!1,null).then(e=>{_dha.proxy.trackData(i.guid,a.host,a.page,a.referrer,a.search,a.hash,_dha.utils.detectSourceByUrl(),"pageview",null,null,e,_dha.utils.hasEmail())});var s=!1,u=!1,c=!1;if(o&&_dha.utils.isValidEmail(o)&&(s=!0,o===_dha.storage.getItem("_dha__em")&&(u=!0),c=_dha.utils.isFirstEmail(),_dha.storage.setItem("_dha__em",o)),i.isNewGuid)_dha.proxy.addVisitor(i.guid,s?o:null,window.location.host,c);else if(s&&!u)_dha.proxy.updateVisitor(i.guid,o,null,null,window.location.host,c);else if(localStorage.getItem("_dha__vud")){var d=new Date(JSON.parse(localStorage.getItem("_dha__vud")));new Date>d&&_dha.proxy.updateVisitor(i.guid,s?o:null,null,null,window.location.host,c)}},savePushNotificationToken:function(e,t){var r=_dha.storage.getItem("_dha__uuid"),n=_dha.storage.getItem("_dha__push_token");return!!r&&(!n||t?(_dha.storage.setItem("_dha__push_token","true"),_dha.proxy.updateVisitor(r,null,null,null,window.location.host,!1,e)):void 0)},trackForm:function(){var t=e(arguments);t.trackForm.length>0?_dha.trackFormByParameters(t.trackForm,t.navigatedPage,t.hash,t.search):_dha.trackAllForm(t.navigatedPage,t.hash,t.search)},trackFormByParameters:function(e,r,n,o){var i=_dha.storage.getItem("_dha__uuid");e.forEach(function(e){var a="",s=document.querySelector("#"+e.id_form_track);s?a="#"+e.id_form_track:(s=document.querySelector("form[name="+e.id_form_track+"]"))&&(a="form[name="+e.id_form_track+"]"),a&&document.forms[e.id_form_track].addEventListener("submit",function(){var s=[];if(e.id_input_track.length>0)e.id_input_track.forEach(function(e){var t,r=document.querySelector(a+" #"+e);t=r?r.getAttribute("id"):(r=document.querySelector(a+" input[name="+e+"]")).getAttribute("name");var n=r.getAttribute("type");if(t&&t.indexOf("email")>-1||n&&"email"===n.toLowerCase()){var o=r.value;if(o&&_dha.utils.isValidEmail(o)){const e=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(i,o,null,null,window.location.host,e),_dha.storage.setItem("_dha__em",o)}}n&&"password"!=n.toLowerCase()&&"hidden"!=n.toLowerCase()&&r.value&&s.push({name:t,value:r.value})});else{var u=document.querySelectorAll(a+" input");[].forEach.call(u,function(e){input_id=e.getAttribute("id")?e.getAttribute("id"):e.getAttribute("name");var t=e.getAttribute("type");t&&"password"!=t.toLowerCase()&&"hidden"!=t.toLowerCase()&&e.value&&s.push({name:input_id,value:e.value})})}if(s.length>0){r||window.location.pathname;const a=t(r,o,n);_dha.proxy.trackData(i,a.host,a.page,a.referrer,a.search,a.hash,"","formevent",e.id_form_track,s,null,_dha.utils.hasEmail(),!1)}})})},trackAllForm:function(e,r,n){[].forEach.call(document.forms,function(o){var i=[],a=o.getAttribute("id");a||(a=o.getAttribute("name"))||(a="");var s=_dha.storage.getItem("_dha__uuid");o.addEventListener("submit",function(){var o=this.querySelectorAll("input");if([].forEach.call(o,function(e){var t=e.getAttribute("id"),r=e.getAttribute("type");if(t||(t=e.getAttribute("name")),t&&t.indexOf("email")>-1||r&&"email"===r.toLowerCase()){var n=e.value;if(n&&_dha.utils.isValidEmail(n)){const e=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(s,n,null,null,window.location.host,e),_dha.storage.setItem("_dha__em",n)}}r&&"password"!=r.toLowerCase()&&"hidden"!=r.toLowerCase()&&e.value&&i.push({name:t,value:e.value})}),i.length>0){const o=t(e,n,r);_dha.proxy.trackData(s,o.host,o.page,o.referrer,o.search,o.hash,"","formevent",a,i,null,_dha.utils.hasEmail(),!1)}})})},linkDomains:function(e){o(e)},trackInputEmail:function(e){i(e)},trackDOMMutation:function(){const e=document.body;new MutationObserver(function(e,t){for(let t of e)"childList"===t.type&&t.addedNodes&&t.addedNodes.length>0&&(i(t.target),o(t.target))}).observe(e,{childList:!0,subtree:!0})},trackNavigationOnChangeStateDebounced:function(e,t){let r;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e(this,...n)},t)}}((e,t)=>{console.log("_dha.pageInfoUtils.currentUrl: ",_dha.pageInfoUtils.currentUrl,"window.location.href: ",window.location.href),_dha.pageInfoUtils.currentUrl!==window.location.href&&(_dha.pageInfoUtils.currentUrl=window.location.href,"object"==typeof t.url?r(t.url.pathname,t.url.search,t.url.hash,t.referrer,t.state):r(t.url,null,null,t.referrer,t.state)),e._isObserving&&(e.disconnect(),e._isObserving=!1)},2500),trackChangeState:function(){const e=window.history.pushState;let t,r={};const n={childList:!0,subtree:!0};t=new MutationObserver(e=>{!function(e,t,r){e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{}),_dha.trackNavigationOnChangeStateDebounced(t,r))})}(e,t,r)}),window.history.pushState=function(t,r,n){return"function"==typeof window.history.onpushstate_cdh&&window.history.onpushstate_cdh({state:t,unused:r,url:n}),e.apply(window.history,arguments)},window.history.onpushstate_cdh=function(e){const o=window.location.pathname;r={url:e.url||window.location,referrer:o,state:"onpushstate"},t._isObserving||(t.observe(document.body,n),t._isObserving=!0)},window.addEventListener("popstate",function(e){const o=window.location;r={url:o.pathname,search:o.search,hash:o.hash,referrer:document.referrer,state:"onpopstate"},t._isObserving||(t.observe(document.body,n),t._isObserving=!0)})},updateUrlLink:function(e){if(e){var t=document.querySelectorAll(".dh--link--exit");[].forEach.call(t,function(t){t.onclick=function(){t.href=-1===t.href.indexOf("?")?t.href+"?dha_id="+e:t.href+"&dha_id="+e}})}},trackEmail:function(e){_dha.utils.trackVisitorEmail(e)}}}();_dha.proxy=function(){var e={local:!1};document.location.protocol;function t(){return e.local?"http://localhost:3000":CUSTOMER_DATA_HUB_API_SERVER}function r(){var e=new Date;return e.setMinutes(e.getMinutes()+14400),e}return{config:function(t){e=t},addVisitor:function(e,n,o,i){_dha.storage.setItem("_dha__vud",JSON.stringify(r()));var a=new XMLHttpRequest;a.open("POST",t()+"/api/visitors"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.onload=function(e){4===a.readyState&&(200===a.status||console.error(a.statusText))},a.onerror=function(e){console.error(a.statusText)},a.send(JSON.stringify({visitor:{visitorGuid:e,email:n,domain:o,isFirstEmail:i}}))},aliasVisitor:function(e,r){var n=new XMLHttpRequest;n.open("POST",t()+"/api/alias"),n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.onload=function(e){4===n.readyState&&(200===n.status||console.error(n.statusText))},n.onerror=function(e){console.error(n.statusText)},n.send(JSON.stringify({visitor:{visitor_1:e,visitor_2:r}}))},updateVisitor:function(e,n,o,i,a,s,u){_dha.storage.setItem("_dha__vud",JSON.stringify(r()));var c=new XMLHttpRequest,d=t()+"/api/visitors/"+e;c.open("POST",d),c.setRequestHeader("Content-Type","application/json;charset=UTF-8"),c.onload=function(e){4===c.readyState&&(200===c.status||console.error(c.statusText))},c.onerror=function(e){console.error(c.statusText)},c.send(JSON.stringify({visitor:{visitorGuid:e,email:n,username:o,fullname:i,domain:a,isFirstEmail:s,pushNotificationToken:u}}))},trackData:function(e,r,n,o,i,a,s,u,c,d,l,p,h){h=void 0===h||h;var f=new XMLHttpRequest;f.open("POST",t()+"/api/data",h),f.setRequestHeader("Content-Type","application/json;charset=UTF-8"),f.onload=function(e){4===f.readyState&&(200===f.status||console.error(f.statusText))},f.onerror=function(e){console.error(f.statusText)},f.send(JSON.stringify({visitor:{visitorGuid:e,domain:r,page:n,referrer:o,queryString:i,hash:a,source:s,eventType:u,eventName:c,additionalInfo:d,pageInfo:l,scriptVersion:window.CDH_VERSION,userAgent:navigator.userAgent,appName:navigator.appName,appVersion:navigator.appVersion,hasEmail:p}}))}}}(),_dha.storage=function(){var e=!1,t=!1;function r(){t||(e=function(){var e="_dha__ck";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}(),t=!0)}return{setItem:function(t,n){r(),e?function(e,t){localStorage.setItem(e,t)}(t,n):function(e,t){var r=new Date;r.setTime(r.getTime()+31536e7);var n="expires="+r.toUTCString();document.cookie=e+"="+t+"; "+n+"path=/"}(t,n)},getItem:function(t){return r(),e?function(e){return localStorage.getItem(e)}(t):function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n-1})},isStringIntoArrayOfString:function(e,t){return t.indexOf(e)>-1},detectSourceByUrl:function(){var e=["twitter","facebook","linkedin","pinterest","plus.google","youtube","instagram"],t=["google","bing","duckduckgo","exalead","gigablast","munax","qwant","yahoo","yandex"],r=_dha.utils.getParameterByName("utm_medium"),n=_dha.utils.getParameterByName("utm_source"),o=_dha.utils.getParameterByName("utm_campaign");const i=!!_dha.utils.getParameterByName("dplrid");var a=[];if(r&&(r=r.toLowerCase(),a.push(r)),n&&(n=n.toLowerCase(),a.push(n)),o&&(o=o.toLowerCase(),a.push(o)),"social"===r){if(_dha.utils.isStringIntoArrayOfString(n,e))return"Social";if(window.cdhReferrer&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,e))return"Social"}return _dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,e)?"Social":_dha.utils.isStringIntoArrayOfSubstring(n,["email"])||_dha.utils.isStringIntoArrayOfSubstring(r,["email"])||_dha.utils.isStringIntoArrayOfSubstring(o,["email"])||i?"Email":_dha.utils.isStringIntoArrayOfSubstring(n,["adword","ppc","cpc"])||_dha.utils.isStringIntoArrayOfSubstring(r,["adword","ppc","cpc"])||_dha.utils.isStringIntoArrayOfSubstring(o,["adword","ppc","cpc"])?"Paid":_dha.utils.getParameterByName("gclid")?"Paid":window.cdhReferrer&&a.length>0&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,a)?"Paid":window.cdhReferrer&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,t)?"Organic":!window.cdhReferrer||_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,t)&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,e)?"Direct":"Referral"},generateBrowserFingerprint:function(){var e=(new Date).getTime(),t=window.navigator,r=window.screen,n=t.mimeTypes.length;n+=t.userAgent.replace(/\D+/g,""),n+=t.plugins.length,n+=r.height||"",n+=r.width||"";for(var o=e+(n+=r.pixelDepth||""),i=[8,4,4,4,12],a=[],s=0,u=0;u>8&255]+e[r>>16&255]+e[r>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&o|128]+e[o>>8&255]+"-"+e[o>>16&255]+e[o>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]},isMobile:function(){const r=navigator.userAgent||navigator.vendor||window.opera;return e.test(r)||t.test(r.substr(0,4))}}}(),_dha.UI=function(){var e={},t=0,r=!1;function n(e){var t;return function e(t,r){for(var n in r)t.hasOwnProperty(n)?"object"==typeof r[n]&&e(t[n],r[n]):t[n]=r[n]}(t="object"==typeof e[0]?e[0]:{},{delay_capturer_display:0,mobile:!1,leave_window:!1,after_time:{show:!1,time:1e4},repeat_after_time:2592e6,capturer_info:{handle_by_lib:!0,import_file:!0,capturer_id:"dha-capturer-container",form_id:"dha-capturer-form"}}),t}return{config:function(t){e=t},init:function(){window.onblur=function(){r=!0},window.onfocus=function(){r=!1},e.capturer_info.handle_by_lib&&(document.onclick=function(t){t.target.id!=e.capturer_info.capturer_id&&"dha-close-popup"!=t.target.id&&"dha-close-popup"!=t.target.parentElement.id||(document.getElementById(e.capturer_info.capturer_id).style.display="none")})},captureEmail:function(){if(!_dha.storage.getItem("_dha__ps")){if(_dha.UI.config(n(arguments)),_dha.utils.isMobile()&&!e.mobile)return;if(e.capturer_info.import_file){var t=document.querySelector("#dha-capturer-file");t&&t.href&&fetch(t.href).then(function(e){return e.text()}).then(function(e){var t=document.createElement("div");t.innerHTML=e,document.body.appendChild(t)})}_dha.UI.init(),_dha.UI.verify_time_to_repeat(),e.after_time.show&&_dha.UI.show_popup_after_period_a_time(),e.leave_window&&setTimeout(function(){document.onmouseout=function(e){if(!_dha.storage.getItem("_dha__ped")){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!=t.nodeName||_dha.UI.show_popup()}}},e.delay_capturer_display),e.capturer_info.handle_by_lib||_dha.UI.bindCapturerSubmit()}},validateCapturer:function(){var t="#"+e.capturer_info.form_id,r=document.querySelector(t+" #email");return document.querySelector(t+" #dha-error-email-empty").style.display="none",document.querySelector(t+" #dha-error-email-invalid").style.display="none",r.value?_dha.utils.isValidEmail(r.value)?void _dha.UI.registerInfoPopup(r.value):(r.className&&-1==r.className.indexOf("dha-error")?r.className+=" dha-error":r.className||(r.className="dha-error"),void(document.querySelector(t+" #dha-error-email-invalid").style.display="block")):(r.className&&-1==r.className.indexOf("dha-error")?r.className+=" dha-error":r.className||(r.className="dha-error"),void(document.querySelector(t+" #dha-error-email-empty").style.display="block"))},show_popup_after_period_a_time:function(){time=e.after_time.time,delta=100,_dha.storage.getItem("_dha__ped")||(t=setInterval(function(){r?time=e.after_time.time:(time-=delta,time<=0&&(clearInterval(t),_dha.UI.show_popup()))},delta))},verify_time_to_repeat:function(){if(_dha.storage.getItem("_dha__ped")){popup_exit_date=new Date(JSON.parse(localStorage.getItem("_dha__ped"))),max_date_popup=new Date(JSON.parse(localStorage.getItem("_dha__ped")));var t=Math.floor(e.repeat_after_time/1e3/60);max_date_popup.setMinutes(max_date_popup.getMinutes()+t),current_time=new Date,current_time>max_date_popup&&_dha.storage.deleteItem("_dha__ped")}},show_popup:function(){if(_dha.storage.setItem("_dha__ped",JSON.stringify(new Date)),clearInterval(t),e.capturer_info.handle_by_lib){var r="#"+e.capturer_info.form_id,n=document.querySelector(r+" #email");n.className=n.className.replace("dha-error",""),document.querySelector(r+" #dha-error-email-empty").style.display="none",document.querySelector(r+" #dha-error-email-invalid").style.display="none",document.querySelector(r+" div.dha-before-submit").style.display="block",document.querySelector(r+" div.dha-after-submit").style.display="none",document.querySelector(r+" div.dha-inputs-holder").style.display="block"}document.querySelector("div#"+e.capturer_info.capturer_id)&&(document.querySelector("div#"+e.capturer_info.capturer_id).style.display="block")},bindCapturerSubmit:function(){var t=_dha.storage.getItem("_dha__uuid"),r=document.querySelector("#"+e.capturer_info.form_id);r&&r.addEventListener("submit",function(){var e=this.querySelector("#email").value;if(e&&_dha.utils.isValidEmail(e)){const r=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(t,e,null,null,window.location.host,r),_dha.storage.setItem("_dha__em",e),_dha.storage.setItem("_dha__ps",new Date)}})},registerInfoPopup:function(t){var r=_dha.storage.getItem("_dha__uuid");const n=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(r,t,null,null,window.location.host,n),_dha.storage.setItem("_dha__em",t),_dha.storage.setItem("_dha__ps",new Date);var o="#"+e.capturer_info.form_id;document.querySelector(o+" div.dha-before-submit").style.display="none",document.querySelector(o+" div.dha-after-submit").style.display="block",document.querySelector(o+" div.dha-inputs-holder").style.display="none",setTimeout(function(){document.getElementById(e.capturer_info.capturer_id).style.display="none"},4e3)}}}(),_dha.pageInfo={getPageInformation:(e,t)=>new Promise(r=>{let n={pageType:void 0,productId:void 0,price:void 0,categoryId:void 0};const o=_dha.ecommerceServicesUtils.identifyEcommerce();try{switch(o){case"shopify":n=_dha.shopify.getPageInfo(e);break;case"tienda-nube":n=_dha.tiendaNube.getPageInfo(e,t);break;case"magento":n=_dha.magento.getPageInfo(e);break;case"vtex":n=_dha.vtex.getPageInfo(e);break;case"mercadoshops":case"mercadolibre":n=_dha.meli.getPageInfo();break;case"woocommerce":n=_dha.woocommenrce.getPageInfo(n);break;default:n=_dha.garbarino.getPageInfo()}}catch(e){console.log(e)}n=_dha.pageInfoUtils.setOpenGraphInfoToPageInfo(n),_dha.pageInfoUtils.completeAndSanitizePageInfo(n).then(e=>{r(e)})})},_dha.pageInfoUtils={currentUrl:"",getPageTypeByMeta:e=>{if(!e){const e=_dha.pageInfoUtils.getTagsByNameAndAttribute("meta",[{attName:"property",attValue:"og:type"}]);if(e&&e.length>0)return e[0].getAttribute("content")}return e},setOpenGraphInfoToPageInfo:e=>{if(!e.pageType){const t=_dha.pageInfoUtils.getPageTypeByMeta(e.pageType);e.pageType=t}if(!e.price){const t=_dha.pageInfoUtils.getTagsByNameAndAttribute("meta",[{attName:"property",attValue:"og:price"},{attName:"property",attValue:"og:price:amount"},{attName:"property",attValue:"product:price:amount"}]);t&&t.length>0&&(e.price=t[0].getAttribute("content"))}return e},sanitizePageInfo:(e,t)=>({pageType:e.pageType?e.pageType:void 0,productId:e.productId?e.productId.toString():void 0,price:e.price?e.price:t.price,categoryId:e.categoryId?e.categoryId.toString():void 0,cartId:e.cartId?e.cartId.toString():void 0,items:e.items&&e.items.length>=1?e.items:void 0,eCommerceCustomer:e.eCommerceCustomer?e.eCommerceCustomer.toString():void 0,image:t.image,name:t.title,url:t.url,source:t.source}),completeAndSanitizePageInfo:e=>new Promise((t,r)=>{e.pageType?_dha.pageInfoUtils.validateIfPageIsProduct(e.pageType)?_dha.pageInfoUtils.getProductInfo().then(r=>{const n=_dha.pageInfoUtils.sanitizePageInfo(e,r||{});t(n)}).catch(e=>r(e)):t(_dha.pageInfoUtils.sanitizePageInfo(e,{})):t(null)}),getTagsByNameAndAttribute:(e,t,r)=>{const n=(r||document).getElementsByTagName(e),o=[];for(let e=0;e{const e=document.documentElement.outerHTML;return fetch(`${SCRAPING_API_SERVER}/product-by-ia`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:e})}).then(e=>e.json()).then(e=>e).catch(e=>e)},getProductInfo:()=>new Promise(e=>{const t=_dha.pageInfoUtils.getProductByMeta();if(_dha.pageInfoUtils.checkProductIsComplete(t))return t.source="METADATA",void e(t);const r=_dha.pageInfoUtils.getProductByWPN();if(_dha.pageInfoUtils.checkProductIsComplete(r))return r.source="LOCAL_STORAGE_WPN",void e(r);_dha.pageInfoUtils.checkAndGetProductByAI().then(t=>{if(t)return t.url=window.location.href,t.source="IA",t.title=t.name,void e(t);e({})}).catch(e=>e)}),getProductByMeta:()=>{const e={},t=Array.from(document.getElementsByTagName("meta")),r={price:e=>/^[0-9]{1,9}(\.[0-9]+)?|[0-9]{1,9}(,[0-9]{9})*(\.[0-9]+)?$/.test(e),image:e=>/^https:\/\/.*/.test(e),":id":e=>/^https:\/\/.*/.test(e),title:()=>!0,url:()=>!0};return t.forEach(t=>{const n=t.getAttribute("property");if(!n)return;const o=Object.keys(r).find(e=>n.includes(e));o&&r[o](t.content)&&(e[":id"===o?"id":o]=t.content)}),e},getProductByWPN:()=>{const e=localStorage.getItem("wpn-local-history"),t={};if(e){const r=JSON.parse(e);r.length>0&&(t.image=r[0].image,t.price=r[0].price,t.title=r[0].title,t.url=r[0].url)}return t},checkProductIsComplete:e=>{if(e){const t=Object.keys(e),r=["image","title","url"];for(let e=0;enew Promise((e,t)=>{let r=0;const n=setInterval(()=>{if(r<_dha.popUpHubWidgets.maxAttemptsCheckWidgetConfig){if(r++,void 0!==_dha.popUpHubWidgets.widgetConfig&&_dha.popUpHubWidgets.widgetConfig.widgets){r=_dha.popUpHubWidgets.maxAttemptsCheckWidgetConfig,_dha.popUpHubWidgets.widgetConfig.widgets.some(e=>_dha.popUpHubWidgets.widgetTypes.includes(e.type))&&(clearInterval(n),_dha.pageInfoUtils.getProductByAI().then(t=>{e(t)}).catch(e=>{t(e)}))}}else clearInterval(n),e()},500)}),validateIfPageIsProduct:e=>{return/product/.test(e)}},_dha.garbarino={getPageInfo:()=>{const e={pageType:void 0,productId:void 0,price:void 0,categoryId:void 0};if(window.dataLayer){let t;for(let e=0;e{const t={pageType:e?"cart":void 0,productId:void 0,price:void 0,categoryId:void 0,items:void 0};if(t.pageType||(t.pageType=/\/checkout\//.test(window.location.pathname)?"checkout":void 0),"cart"===t.pageType){const e=_dha.pageInfoUtils.getTagsByNameAndAttribute("form",[{attName:"id",attValue:"product_addtocart_form"}]);t.productId=e&&e.length>0&&e[0].getAttribute("data-product-sku")}if("cart"===t.pageType||"checkout"===t.pageType){const e=JSON.parse(_dha.storage.getItem("mage-cache-storage"));if(e&&e.cart&&e.cart.items){const r=e.cart.items.map(e=>({item_id:e.item_id,product_id:e.product_id,sku:e.product_sku}));t.items=r}}return t},listenerAddProductToCart:({widget:e,rule:t},r)=>{require(["jquery"],n=>{n(document).on("ajax:addToCart",(n,o)=>{r({widget:e,rule:t},o.productIds[0])})})},isCurrentPlatform:()=>!!_dha.storage.getItem("mage-cache-storage")},_dha.shopify={getPageInfo:e=>{const t={pageType:e?"cart":void 0,productId:void 0,price:void 0,categoryId:void 0};return window.meta&&(t.pageType||(t.pageType=window.meta.page&&window.meta.page.pageType),window.meta.product&&(t.productId=window.meta.product.id,t.price=window.meta.product.variants&&window.meta.product.variants.length>0?window.meta.product.variants[0].price:void 0)),t},isCurrentPlatform:()=>!("undefined"==typeof Shopify||!Shopify||!Shopify.shop)},_dha.tiendaNube={getPageInfo:(e,t)=>{const r={pageType:e?"cart":window.LS.template,productId:void 0,price:void 0,categoryId:void 0};let n;if(r.pageType||(r.pageType=/^\/checkout\//.test(window.location.pathname)?"checkout":void 0),e&&t&&t.involvedForm){const e=_dha.pageInfoUtils.getTagsByNameAndAttribute("input",[{attName:"name",attValue:"add_to_cart"}],t.involvedForm);n=e&&e.length>0&&e[0].value||void 0}if(r.cartId=window.LS.cart?window.LS.cart.id:void 0,r.productId=n||window.LS.product&&window.LS.product.id||void 0,r.price=window.LS.variants&&window.LS.variants.length>0?window.LS.variants[0].price_number:void 0,r.categoryId=window.LS.category?window.LS.category.id:void 0,r.eCommerceCustomer=window.LS.customer,r.eCommerceCustomer){const e=new XMLHttpRequest;e.open("GET","/account/info/",!0),e.responseType="document",e.onload=function(){if(4===e.readyState)if(200===e.status){const t=e.responseXML.getElementsByName("email");if(t&&t.length>0){Array.prototype.slice.call(t).forEach(e=>{_dha.utils.isValidEmail(e.value)&&_dha.utils.trackVisitorEmail(e.value)})}}else console.error(`${e.status} => ${e.statusText}`)},e.onerror=function(){console.error(`${e.status} => ${e.statusText}`)},e.send()}return r},listenerAddProductToCart:({widget:e,rule:t},r)=>{window.addEventListener("productAddedToCart",n=>{r({widget:e,rule:t},n.detail.cart_item.product.id)})},isCurrentPlatform:()=>!!window.LS},_dha.vtex={getPageInfo:e=>{const t=_dha.pageInfoUtils.getPageTypeByMeta(),r=_dha.pageInfoUtils.getProductByMeta();return{pageType:e?"cart":t,productId:r.id?r.id:void 0,price:r.price?r.price:void 0,categoryId:r.categoryId?r.categoryId:void 0}},isCurrentPlatform:()=>!!window.vtex},_dha.meli={getPageInfo:()=>{const e={pageType:void 0,productId:void 0,price:void 0,categoryId:void 0};e.pageType=_dha.pageInfoUtils.getPageTypeByMeta(e.pageType);const t=window.__PRELOADED_STATE__;if(t&&t.initialState&&t.initialState.schema&&Array.isArray(t.initialState.schema)){const r=t.initialState.schema[0];if(!r)return e;e.title=r.name,e.image=r.image,r.offers&&(e.url=r.offers.url,e.price=r.offers.price)}return e}},_dha.woocommenrce={getPageInfo:e=>{if(e.pageType=/\/product\/|\/producto\//.test(window.location.href)?"product":void 0,!e.pageType){const t=_dha.pageInfoUtils.getPageTypeByMeta(e.pageType);e.pageType="article"===t?"product":t}return e}},_dha.ecommerceServicesUtils={identifyEcommerce:()=>_dha.shopify.isCurrentPlatform()?"shopify":_dha.tiendaNube.isCurrentPlatform()?"tienda-nube":_dha.magento.isCurrentPlatform()?"magento":_dha.vtex.isCurrentPlatform()?"vtex":_dha.ecommerceServicesUtils.getEcommerce(),getEcommerce:()=>{const e=["mercadoshops","mercadolibre","jumpseller","prestashop","woocommerce"],t=Array.from(document.getElementsByTagName("link"));let r;for(let n=0;n{const e=new Date,t=new Date(e.getFullYear(),e.getMonth()-1,e.getDate());return`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`},visitorCounter:e=>{if(!e.visitorCounterHasIncreased){e.visitorCounterHasIncreased=!0;const t=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),r=t.dphWidget;r.visitorCounter.amount+=1,_dha.popUpHubUtils.saveLocalStorage(e.widgetId,t.dphWidgetsStorage,r)}},fillLocalStorage:(e,t)=>{let r=JSON.parse(t);r||(r={});const n=_dha.popUpHubUtils.getNewTime(),o=_dha.ecommerceServicesUtils.identifyEcommerce();r[e]={showPerday:{date:n,amount:0},visitorCounter:{date:n,amount:0},openWidgetCounter:{date:n,amount:0},smartFormData:{completed:!1},[`cart_items_${o}`]:[]},localStorage.setItem(_dha.popUpHubWidgets.key,JSON.stringify(r))},getNewTime:()=>{const e=new Date;return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`},getInfoByLocalStorage:e=>{const t=localStorage.getItem(_dha.popUpHubWidgets.key);if(t){const r=JSON.parse(t),n=r[e];if(n)return{dphWidgetsStorage:r,dphWidget:n}}return _dha.popUpHubUtils.fillLocalStorage(e,t),_dha.popUpHubUtils.getInfoByLocalStorage(e)},saveLocalStorage:(e,t,r)=>{t[e]=r,localStorage.setItem(_dha.popUpHubWidgets.key,JSON.stringify(t))},debounce:(e,t)=>{let r;return function(...n){clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}},incrementWidgetOpenCount:e=>{const t=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),r=t.dphWidget;r.openWidgetCounter.amount+=1,_dha.popUpHubUtils.saveLocalStorage(e.widgetId,t.dphWidgetsStorage,r)},addToCartListenerByEcommerce:({widget:e,rule:t})=>{switch(_dha.ecommerceServicesUtils.identifyEcommerce()){case"tienda-nube":_dha.tiendaNube.listenerAddProductToCart({widget:e,rule:t},_dha.popUpHubRules.addToCartListenerCallBack);break;case"magento":_dha.magento.listenerAddProductToCart({widget:e,rule:t},_dha.popUpHubRules.addToCartListenerCallBack)}},getDateFromOnASpecificDateRule:e=>{if(e&&e.length>0){const t=e.split("|");if(Array.isArray(t)&&t.length>0){const e=new Date(t[0]);if(!isNaN(e))return e}}}},_dha.popUpHubRules={ruleResult:!1,sanitizeUrl:e=>e.replace(/\/$/,""),checkDomains:e=>{for(const t of e.domains)if(void 0===t.path||null===t.path||"*"===t.path||_dha.popUpHubRules.sanitizeUrl(t.path)===_dha.popUpHubRules.sanitizeUrl(window.location.pathname)||t.path.slice(0,t.path.length-2)===window.location.pathname&&"/*"===t.path.slice(-2))return!0;return!1},exitPageValidation:({widget:e,rule:t})=>{document.addEventListener("mouseout",r=>{!r.relatedTarget&&r.clientY<=0&&(t.result=!0,_dha.popUpHubRules.validateRules(e))})},scrollConditionValidation:({widget:e,rule:t})=>{let r=(document.body.scrollHeight-window.innerHeight)*(t.field.value/100);return window.addEventListener("scroll",()=>{r{setTimeout(()=>{t.result=!0,_dha.popUpHubRules.validateRules(e)},1e3*t.field.value)},hasSeenSectionsAmount:({widget:e,rule:t})=>{return _dha.popUpHubUtils.visitorCounter(e),_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.visitorCounter.amount>=t.field.value},showsPerDayValidation:({widget:e,rule:t})=>{const r=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),n=r.dphWidget;return new Date(n.showPerday.date).getTime()===new Date(_dha.popUpHubUtils.getNewTime()).getTime()?n.showPerday.amount+=1:(n.showPerday.amount=0,n.showPerday.date=_dha.popUpHubUtils.getNewTime()),_dha.popUpHubUtils.saveLocalStorage(e.widgetId,r.dphWidgetsStorage,n),n.showPerday.amount<=t.field.value},afterShownAmountValidation:({widget:e,rule:t})=>{return _dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.openWidgetCounter.amount<=t.field.value},afterShowToUserAmountValidation:({widget:e,rule:t})=>{return _dha.popUpHubUtils.visitorCounter(e),_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.visitorCounter.amount<=t.field.value},isNotInBrowser:({rule:e,clientData:t})=>e.key.toLowerCase()!==t.browser.toLowerCase(),isNotInDevice:({rule:e,clientData:t})=>e.key.toLowerCase()!==t.device.toLowerCase(),isCheckoutPage:()=>{const e=window.location.href;return/checkout/i.test(e)},isCheckoutSuccessPage:()=>{const e=window.location.href;return/checkout.*success/.test(e)},showOnEveryCheckoutAccess:({widget:e,rule:t})=>(_dha.popUpHubUtils.addToCartListenerByEcommerce({widget:e,rule:t}),_dha.popUpHubRules.isCheckoutPage()),immediatelyAfterProductAddedToCart:({widget:e,rule:t})=>{_dha.popUpHubUtils.addToCartListenerByEcommerce({widget:e,rule:t})},timeElapsedInCheckoutSection:({widget:e,rule:t})=>{_dha.popUpHubUtils.addToCartListenerByEcommerce({widget:e,rule:t}),_dha.popUpHubRules.isCheckoutPage()&&_dha.popUpHubRules.waitingTimeValidation({widget:e,rule:t})},ruleIsOR:(e,t)=>e.operator&&"OR"===e.operator&&t,ruleIsAnd:(e,t)=>e.operator&&"AND"===e.operator&&!t,showFromDateValidation:({rule:e})=>{const t=_dha.popUpHubUtils.getDateFromOnASpecificDateRule(e.field.value);return!!t&&t{const t=_dha.popUpHubUtils.getDateFromOnASpecificDateRule(e.field.value);return!!t&&t>new Date},saveCartItemsLocalStorage:({widget:e,rule:t},r)=>{const n=_dha.ecommerceServicesUtils.identifyEcommerce(),o=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),i=o.dphWidget;switch(t.jsFn){case"immediatelyAfterProductAddedToCart":i[`cart_items_${n}`]=[r];break;default:i[`cart_items_${n}`].push(r)}_dha.popUpHubUtils.saveLocalStorage(e.widgetId,o.dphWidgetsStorage,i)},addToCartListenerCallBack:({widget:e,rule:t},r)=>{_dha.popUpHubRules.saveCartItemsLocalStorage({widget:e,rule:t},r),"immediatelyAfterProductAddedToCart"===t.jsFn&&(t.result=!0,_dha.popUpHubRules.validateRules(e))},checkRules:e=>{for(const t of e){if(_dha.popUpHubRules.ruleResult=!!t.result&&t.result,_dha.popUpHubRules.ruleIsOR(t,_dha.popUpHubRules.ruleResult))break;if(_dha.popUpHubRules.ruleIsAnd(t,_dha.popUpHubRules.ruleResult))break;if(t.options){if(_dha.popUpHubRules.checkRules(t.options),t.result=_dha.popUpHubRules.ruleResult,_dha.popUpHubRules.ruleIsOR(t,_dha.popUpHubRules.ruleResult))break;if(_dha.popUpHubRules.ruleIsAnd(t,_dha.popUpHubRules.ruleResult))break}}},validateRules:e=>{_dha.popUpHubRules.checkDomains(e)&&(0!==e.settings.rules.length?(_dha.popUpHubRules.ruleResult=!1,_dha.popUpHubRules.checkRules(e.settings.rules),e.settings.rules.some(e=>!1===e.result)||_dha.popUpHubWidgets.showWidgetByWidgetType({widget:e})):_dha.popUpHubWidgets.showWidgetByWidgetType({widget:e}))}},_dha.popUpHubEvents={eventTypes:{OPEN:"OPEN",CLOSE:"CLOSE",CLICK:"CLICK",SCROLL:"SCROLL",PARTIAL_SUBMIT:"PARTIAL_SUBMIT",FINAL_SUBMIT:"FINAL_SUBMIT"},widgetNotCountRightClick:["smart-form"],trackEvents:e=>{const t=`${POPUP_HUB_API_SERVER}/event/create`;fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then().catch()},clickEvent:(e,t,r)=>{if(!Array.from(t.classList).find(e=>"u-close-button"===e)){const n=_dha.popUpHubEvents.getTrackInfoForClickEvent({widgetId:r,event:e,tag:t,eventType:_dha.popUpHubEvents.eventTypes.CLICK});_dha.popUpHubEvents.trackEvents(n)}},getTrackInfoForClickEvent:({widgetId:e,event:t,tag:r,eventType:n})=>{const o=_dha.popUpHubWidgets.widgetConfig.widgets.find(t=>t.widgetId===e);return{widgetId:e,widgetType:o.type,visitorGuid:localStorage._dha__uuid,type:n,data:{coordinates:{x:t.clientX,y:t.clientY},link:r&&r.href?r.href:null}}},openOrCloseEvent:(e,t)=>{const r={widgetId:e.widgetId,widgetType:e.type,visitorGuid:localStorage._dha__uuid,type:t};_dha.popUpHubEvents.trackEvents(r)},scrollEvent:(e,t)=>{const r={widgetId:e.widgetId,widgetType:e.type,visitorGuid:localStorage._dha__uuid,type:_dha.popUpHubEvents.eventTypes.SCROLL,data:{percentage:(t.scrollTop/(t.scrollHeight-t.clientHeight)*100).toFixed(2),direction:e.scrollPosition{const r=_dha.popUpHubEvents.getTrackInfoForClickEvent({widgetId:t.widgetId,event:e,tag:{href:window.location.href},eventType:_dha.popUpHubEvents.eventTypes.CLICK});_dha.popUpHubEvents.trackEvents(r)},listenScrollRightCtrlAuxEvents:({element:e,widget:t},r)=>{e.addEventListener("scroll",_dha.popUpHubUtils.debounce(()=>{_dha.popUpHubEvents.scrollEvent(t,e)},1800)),_dha.popUpHubEvents.widgetNotCountRightClick.includes(t.type)||(e.addEventListener("mousedown",e=>{(2===e.button||e.ctrlKey&&0===e.button)&&r({event:e,widget:t})}),e.addEventListener("auxclick",e=>{1===e.button&&r({event:e,widget:t})}))}},_dha.popUpHubWidgets={widgetConfig:void 0,widgetTypes:["products-history","last-products"],maxAttemptsCheckWidgetConfig:5,containerId:"dph-button-container",key:"_dph_widget",ruleResult:!1,loadWidgets:()=>new Promise((e,t)=>{const r=localStorage.getItem("_dha__uuid"),n=`${POPUP_HUB_API_SERVER}/widget/read-by-domain?visitorId=${r}`;fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>200===e.status?e.json():null).then(r=>{0===r.widgets.length?t(new Error("Widget not found")):(_dha.popUpHubWidgets.widgetConfig=r,e(r))}).catch(e=>t(e))}),startWidgets:e=>{for(const t of e.widgets)t.popUpHtml&&(_dha.popUpHubWidgets.ruleResult=!1,_dha.popUpHubWidgets.checkShowWidget(t,t.settings.rules,e.clientData),_dha.popUpHubRules.validateRules(t))},showWidget:e=>{if(e.ctaHtml&&0!==e.ctaHtml.trim().length)_dha.popUpHubWidgets.showActionButton(e);else{if(e.storeUrl===window.location.href)return;_dha.popUpHubWidgets.showPopUp(e)}},showPopUp:e=>{if(!e.widgetIsDisplayed){e.widgetIsDisplayed=!0,e.storeUrl=window.location.href,_dha.popUpHubUtils.incrementWidgetOpenCount(e);const t=document.createElement("div"),r=`dph-widget-${e.widgetId}`;t.id=r,t.innerHTML=e.popUpHtml;const n=t.getElementsByClassName("u-close-button")[0];n.removeAttribute("href"),n.addEventListener("click",()=>{_dha.popUpHubWidgets.closePopUp(e,r)});const o=t.getElementsByClassName("u-popup-content");o&&(e.scrollPosition=0,_dha.popUpHubEvents.listenScrollRightCtrlAuxEvents({element:o[0],widget:e},_dha.popUpHubEvents.listenRightCtrlAuxClickCallback)),_dha.popUpHubWidgets.handleAppendHtmlWidget(e,t)}},handleAppendHtmlWidget:(e,t)=>{const r=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId);switch(e.type){case _dha.popUpHubSmartForm.type:if(r.dphWidget.smartFormData.completed)return;document.body.appendChild(t),_dha.popUpHubSmartForm.initSmartForm(e);break;default:document.body.appendChild(t)}_dha.popUpHubEvents.openOrCloseEvent(e,_dha.popUpHubEvents.eventTypes.OPEN)},initButtonContainer:e=>{let t=document.getElementById(`${_dha.popUpHubWidgets.containerId}-${e}`);return t||((t=document.createElement("div")).id=`${_dha.popUpHubWidgets.containerId}-${e}`,t.style.position="fixed",t.style.bottom="0px",t.style.padding="20px",t.style.zIndex="9999",t.style[e]="0px",document.body.appendChild(t)),t},showActionButton:e=>{if(!e.actionButtonIsDisplayed){e.actionButtonIsDisplayed=!0;const t=_dha.popUpHubWidgets.initButtonContainer(e.settings.cta.bubbleLocation),r=document.createElement("div");r.innerHTML=e.ctaHtml,t.appendChild(r),document.getElementsByClassName(`widget-button-${e.widgetId}`)[0].addEventListener("click",()=>{_dha.popUpHubWidgets.showPopUp(e)})}},closePopUp:(e,t,r=!0)=>{document.getElementById(t).remove(),e.widgetIsDisplayed=!1,r&&_dha.popUpHubEvents.openOrCloseEvent(e,_dha.popUpHubEvents.eventTypes.CLOSE)},checkShowWidget:(e,t,r)=>{for(const n of t){const t=_dha.popUpHubRules[n.jsFn];"function"==typeof t?(_dha.popUpHubWidgets.ruleResult=t({widget:e,rule:n,clientData:r}),n.result=_dha.popUpHubWidgets.ruleResult):n.options?(_dha.popUpHubWidgets.checkShowWidget(e,n.options,r),n.result=_dha.popUpHubWidgets.ruleResult):n.result=!0}},getCrosSellingContent:e=>{const t=_dha.ecommerceServicesUtils.identifyEcommerce(),r=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget[`cart_items_${t}`];r&&_dha.popUpHubWidgets.getContentByWidgetIdFromApi(e,r)},getContentByWidgetIdFromApi:(e,t)=>{const r=`${POPUP_HUB_API_SERVER}/widget/content/${e.widgetId}?productsId=${t.toString()}`;fetch(r,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(t=>{t.widgetHTMLContent&&(e.popUpHtml=t.widgetHTMLContent,_dha.popUpHubWidgets.showWidget(e))}).catch(()=>{})},showWidgetByWidgetType:({widget:e})=>{switch(e.type){case"cross-selling":_dha.popUpHubWidgets.getCrosSellingContent(e);break;default:_dha.popUpHubWidgets.showWidget(e)}}},_dha.popUpHubSmartForm={type:"smart-form",widget:null,formSettings:null,intlTelInputCDN:"https://cdn.jsdelivr.net/npm/intl-tel-input@25.2.1/build/js",inputsTel:[],hasInputTelToShow:!1,dataTrack:null,initSmartForm:e=>{_dha.popUpHubSmartForm.widget=e,_dha.popUpHubSmartForm.formSettings=_dha.popUpHubSmartForm.getFormSettings(),_dha.popUpHubSmartForm.cleanUpFormFields(),_dha.popUpHubSmartForm.initSubmitButton()},initTel:()=>{loadScript(activateInput)},initSmartFormTelInput:()=>{const e=document.createElement("script");e.type="text/javascript",e.innerHTML=`\n let iti = [];\n function loadScript(callback) {\n const head = document.getElementsByTagName('head')[0];\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = "${_dha.popUpHubSmartForm.intlTelInputCDN}/intlTelInput.min.js";\n script.onreadystatechange = callback;\n script.onload = callback;\n head.appendChild(script);\n }\n\n const inputTelChange = (evt) => {\n const itiIndex = evt.target.dataset.itiIndex;\n if (iti[itiIndex].getNumber()) {\n if (iti[itiIndex].isValidNumber()) {\n evt.target.value = iti[itiIndex].getNumber(1);\n }\n }\n }\n\n function activateInput() { \n const inputElements = document.querySelectorAll('#dp_sf input[type="tel"]');\n inputElements.forEach((input, index) => {\n input.dataset.itiIndex = index;\n iti[index] = window.intlTelInput(input, {\n nationalMode: false,\n separateDialCode: false,\n autoPlaceholder: 'aggressive',\n preferredCountries: ['ar', 'mx', 'co', 'es', 'ec', 'cl', 'pe', 'us'],\n initialCountry: 'ar',\n customContainer: 'dropdown--full',\n loadUtils: () => import("${_dha.popUpHubSmartForm.intlTelInputCDN}/utils.js"),\n });\n input.addEventListener('change', inputTelChange, false);\n });\n }\n `,document.body.appendChild(e)},getFormSettings:()=>{const e=_dha.popUpHubSmartForm.getTargetForm(),t=_dha.popUpHubSmartForm.getFormData();return{fieldInstance:e.getAttribute("data-field-instance"),targetIdList:e.getAttribute("data-target-id-list"),actionOnFinish:e.getAttribute("data-action-on-finish"),totalFields:t.length,fieldsShown:[]}},getTargetForm:()=>{return document.getElementById(_dha.popUpHubSmartForm.widget.widgetId).querySelector("#dp_sf")},getFormData:()=>{const e=document.getElementById(_dha.popUpHubSmartForm.widget.widgetId).querySelector("#dp_sf"),t=[],r=new Map;for(const t of e.elements)if(t.name)if("tel"!==t.type||_dha.popUpHubSmartForm.inputsTel.includes(t.name)||_dha.popUpHubSmartForm.inputsTel.push(t.name),"checkbox"===t.type){const e=t.getAttribute("data-type"),n=t.name,o=r.get(n);"toggle"===e?r.set(n,t.checked):"checkboxlist"===e&&t.checked?r.set(n,o?`${o},${t.value}`:t.value):r.set(n,o||"")}else r.set(t.name,t.value);for(const[e,n]of r)t.push({name:e,value:n});return t},getUserFormData:()=>{const e=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId);return e.dphWidget.smartFormData?e.dphWidget.smartFormData.data:null},cleanUpFormFields:()=>{const e=_dha.popUpHubSmartForm.getFormData(),t=_dha.popUpHubSmartForm.getUserFormData();let r=0;const n=_dha.popUpHubSmartForm.formSettings.fieldInstance>0?_dha.popUpHubSmartForm.formSettings.fieldInstance:e.length;for(const o of e){(t&&t.fields?t.fields.find(e=>e.name===o.name):null)||r>=n?_dha.popUpHubSmartForm.removeFieldset(o.name):(_dha.popUpHubSmartForm.hasInputTelToShow=_dha.popUpHubSmartForm.hasInputTelToShow||-1!==_dha.popUpHubSmartForm.inputsTel.indexOf(o.name),_dha.popUpHubSmartForm.formSettings.fieldsShown.push(o.name),r++)}_dha.popUpHubSmartForm.hasInputTelToShow&&(_dha.popUpHubSmartForm.initSmartFormTelInput(),_dha.popUpHubSmartForm.initTel())},removeFieldset:e=>{const t=document.getElementById(`fieldset_${e}`);t&&t.remove()},initSubmitButton:()=>{const e=_dha.popUpHubSmartForm.getTargetForm();if(e){const t=e.querySelector("button[type='submit']");t?t.addEventListener("click",t=>{if(e.reportValidity()){t.preventDefault(),_dha.popUpHubSmartForm.updateUserFormData();const e=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId).dphWidget.smartFormData.completed,r=_dha.popUpHubEvents.getTrackInfoForClickEvent({widgetId:_dha.popUpHubSmartForm.widget.widgetId,event:t,tag:{href:window.location.href},eventType:e?_dha.popUpHubEvents.eventTypes.FINAL_SUBMIT:_dha.popUpHubEvents.eventTypes.PARTIAL_SUBMIT});_dha.popUpHubSmartForm.dataTrack=r,_dha.popUpHubSmartForm.sendData()}}):console.error("Submit button not found in the form.")}else console.error("Target form not found with the specified widget ID.")},updateUserFormData:()=>{const e=_dha.popUpHubSmartForm.getFormData(_dha.popUpHubSmartForm.widget.widgetId),t=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId);let r=t.dphWidget.smartFormData.data;r||(r={email:e.find(e=>"EMAIL"===e.name).value,fields:[]}),e.forEach(e=>{r.fields.find(t=>t.name===e.name)||r.fields.push({name:e.name,value:e.value})}),t.dphWidget.smartFormData.completed=r.fields.length===_dha.popUpHubSmartForm.formSettings.totalFields,t.dphWidget.smartFormData.data=r,_dha.popUpHubUtils.saveLocalStorage(_dha.popUpHubSmartForm.widget.widgetId,t.dphWidgetsStorage,t.dphWidget)},sendData:()=>{const e=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId),t=e.dphWidget.smartFormData.data,r=[];for(const e of t.fields){_dha.popUpHubSmartForm.formSettings.fieldsShown.includes(e.name)&&r.push(e)}_dha.popUpHubSmartForm.formSettings.fieldsShown=[];const n={data:{email:t.email,fields:r},widgetId:_dha.popUpHubSmartForm.widget.widgetId,idTargetList:_dha.popUpHubSmartForm.formSettings.targetIdList,dataTrack:_dha.popUpHubSmartForm.dataTrack},o=`${POPUP_HUB_API_SERVER}/widget/smartform/submission`;fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(()=>{e.dphWidget.smartFormData.completed?_dha.popUpHubSmartForm.runCompletionAction():_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)}).catch(e=>{console.error("Error during fetch request:",e)})},runCompletionAction:()=>{switch(_dha.popUpHubSmartForm.formSettings.actionOnFinish){case"message":_dha.popUpHubSmartForm.showThanksMessage(_dha.popUpHubSmartForm.widget.widgetId);break;case"url":_dha.popUpHubSmartForm.redirectUrl(_dha.popUpHubSmartForm.widget.widgetId);break;default:_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)}},showThanksMessage:()=>{const e=document.getElementById(_dha.popUpHubSmartForm.widget.widgetId);if(e){const t=e.querySelectorAll("section");if(t.length>1){const e=t[1].querySelector("span");e&&""!==e.innerHTML.trim()?(t[0].style.display="none",t[1].style.display="block"):_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)}else console.error("Not enough sections were found in the widget's content.")}else console.error("The content of the widget with the specified ID was not found.")},redirectUrl:()=>{const e=_dha.popUpHubSmartForm.getTargetForm(_dha.popUpHubSmartForm.widget.widgetId);if(e){const t=e.getAttribute("data-action-on-finish-url");t?window.open(t,"_blank"):console.warn("The redirection URL was not found in the form.")}else console.error("The form was not found.");_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)}};const startTacking=()=>{_dha.track(),_dha.trackChangeState(),_dha.trackForm({trackForm:[]}),_dha.linkDomains(),_dha.trackInputEmail(),_dha.trackDOMMutation(),_dha.trackAddToCart({formSelectors:[{attName:"class",attValue:"js-product-form"},{attName:"enctype",attValue:"multipart/form-data"},{attName:"id",attValue:"product_addtocart_form"}]})};_dha.popUpHubWidgets.loadWidgets().then(e=>{_dha.popUpHubWidgets.startWidgets(e)}).catch(()=>{}),"loading"!==document.readyState?startTacking():document.addEventListener("DOMContentLoaded",()=>{startTacking()}),(()=>{var e={199:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o,i=r(215),a=r(336),s=r(319),u=r(477),c=((n={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",n["bad-app-name"]="Illegal App name: '{$appName}",n["duplicate-app"]="Firebase App named '{$appName}' already exists",n["app-deleted"]="Firebase App named '{$appName}' already deleted",n["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",n["invalid-log-argument"]="First argument to `onLog` must be null or a function.",n),d=new a.ErrorFactory("app","Firebase",c),l="@firebase/app",p="[DEFAULT]",h=((o={})[l]="fire-core",o["@firebase/analytics"]="fire-analytics",o["@firebase/auth"]="fire-auth",o["@firebase/database"]="fire-rtdb",o["@firebase/functions"]="fire-fn",o["@firebase/installations"]="fire-iid",o["@firebase/messaging"]="fire-fcm",o["@firebase/performance"]="fire-perf",o["@firebase/remote-config"]="fire-rc",o["@firebase/storage"]="fire-gcs",o["@firebase/firestore"]="fire-fst",o["fire-js"]="fire-js",o["firebase-wrapper"]="fire-js-all",o),f=new u.Logger("@firebase/app"),g=function(){function e(e,t,r){var n,o,u=this;this.firebase_=r,this.isDeleted_=!1,this.name_=t.name,this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1,this.options_=a.deepCopy(e),this.container=new s.ComponentContainer(t.name),this._addComponent(new s.Component("app",function(){return u},"PUBLIC"));try{for(var c=i.__values(this.firebase_.INTERNAL.components.values()),d=c.next();!d.done;d=c.next()){var l=d.value;this._addComponent(l)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){return e.firebase_.INTERNAL.removeApp(e.name_),Promise.all(e.container.getProviders().map(function(e){return e.delete()}))}).then(function(){e.isDeleted_=!0})},e.prototype._getService=function(e,t){return void 0===t&&(t=p),this.checkDestroyed_(),this.container.getProvider(e).getImmediate({identifier:t})},e.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=p),this.container.getProvider(e).clearInstance(t)},e.prototype._addComponent=function(e){try{this.container.addComponent(e)}catch(t){f.debug("Component "+e.name+" failed to register with FirebaseApp "+this.name,t)}},e.prototype._addOrOverwriteComponent=function(e){this.container.addOrOverwriteComponent(e)},e.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw d.create("app-deleted",{appName:this.name_})},e}();g.prototype.name&&g.prototype.options||g.prototype.delete||console.log("dc");var m=function e(){var t=function(e){var t={},r=new Map,n={__esModule:!0,initializeApp:function(r,o){void 0===o&&(o={}),"object"==typeof o&&null!==o||(o={name:o});var i=o;void 0===i.name&&(i.name=p);var s=i.name;if("string"!=typeof s||!s)throw d.create("bad-app-name",{appName:String(s)});if(a.contains(t,s))throw d.create("duplicate-app",{appName:s});var u=new e(r,i,n);return t[s]=u,u},app:o,registerVersion:function(e,t,r){var n,o=null!==(n=h[e])&&void 0!==n?n:e;r&&(o+="-"+r);var i=o.match(/\s|\//),a=t.match(/\s|\//);if(i||a){var u=['Unable to register library "'+o+'" with version "'+t+'":'];return i&&u.push('library name "'+o+'" contains illegal characters (whitespace or "/")'),i&&a&&u.push("and"),a&&u.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void f.warn(u.join(" "))}c(new s.Component(o+"-version",function(){return{library:o,version:t}},"VERSION"))},setLogLevel:u.setLogLevel,onLog:function(e,t){if(null!==e&&"function"!=typeof e)throw d.create("invalid-log-argument",{appName:name});u.setUserLogHandler(e,t)},apps:null,SDK_VERSION:"7.20.0",INTERNAL:{registerComponent:c,removeApp:function(e){delete t[e]},components:r,useAsService:function(e,t){return"serverAuth"===t?null:t}}};function o(e){if(e=e||p,!a.contains(t,e))throw d.create("no-app",{appName:e});return t[e]}function c(s){var u,c,l=s.name;if(r.has(l))return f.debug("There were multiple attempts to register component "+l+"."),"PUBLIC"===s.type?n[l]:null;if(r.set(l,s),"PUBLIC"===s.type){var p=function(e){if(void 0===e&&(e=o()),"function"!=typeof e[l])throw d.create("invalid-app-argument",{appName:l});return e[l]()};void 0!==s.serviceProps&&a.deepExtend(p,s.serviceProps),n[l]=p,e.prototype[l]=function(){for(var e=[],t=0;t=0&&f.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var y=m.initializeApp;m.initializeApp=function(){for(var e=[],t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(215),o=r(336),i=function(){function e(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}return e.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},e.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},e.prototype.setServiceProps=function(e){return this.serviceProps=e,this},e}(),a="[DEFAULT]",s=function(){function e(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return e.prototype.get=function(e){void 0===e&&(e=a);var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var r=new o.Deferred;this.instancesDeferred.set(t,r);try{var n=this.getOrInitializeService(t);n&&r.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise},e.prototype.getImmediate=function(e){var t=n.__assign({identifier:a,optional:!1},e),r=t.identifier,o=t.optional,i=this.normalizeInstanceIdentifier(r);try{var s=this.getOrInitializeService(i);if(!s){if(o)return null;throw Error("Service "+this.name+" is not available")}return s}catch(e){if(o)return null;throw e}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(e){var t,r;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService(a)}catch(e){}try{for(var o=n.__values(this.instancesDeferred.entries()),i=o.next();!i.done;i=o.next()){var s=n.__read(i.value,2),u=s[0],c=s[1],d=this.normalizeInstanceIdentifier(u);try{var l=this.getOrInitializeService(d);c.resolve(l)}catch(e){}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},e.prototype.clearInstance=function(e){void 0===e&&(e=a),this.instancesDeferred.delete(e),this.instances.delete(e)},e.prototype.delete=function(){return n.__awaiter(this,void 0,void 0,function(){var e;return n.__generator(this,function(t){switch(t.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all(n.__spread(e.filter(function(e){return"INTERNAL"in e}).map(function(e){return e.INTERNAL.delete()}),e.filter(function(e){return"_delete"in e}).map(function(e){return e._delete()})))];case 1:return t.sent(),[2]}})})},e.prototype.isComponentSet=function(){return null!=this.component},e.prototype.getOrInitializeService=function(e){var t=this.instances.get(e);return!t&&this.component&&(t=this.component.instanceFactory(this.container,function(e){return e===a?void 0:e}(e)),this.instances.set(e,t)),t||null},e.prototype.normalizeInstanceIdentifier=function(e){return this.component?this.component.multipleInstances?e:a:e},e}(),u=function(){function e(e){this.name=e,this.providers=new Map}return e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new s(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e}();t.Component=i,t.ComponentContainer=u,t.Provider=s},477:(e,t,r)=>{"use strict";function n(){for(var e=0,t=0,r=arguments.length;ti,Logger:()=>l,setLogLevel:()=>(function(e){a.forEach(function(t){t.setLogLevel(e)})}),setUserLogHandler:()=>(function(e,t){for(var r=function(r){var n=null;t&&t.level&&(n=s[t.level]),r.userLogHandler=null===e?null:function(t,r){for(var o=[],a=2;a=(null!=n?n:t.logLevel)&&e({level:i[r].toLowerCase(),message:s,args:o,type:t.name})}},n=0,o=a;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(215),o={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},i=function(e,t){if(!e)throw a(t)},a=function(e){return new Error("Firebase Database ("+o.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},s=function(e){for(var t=[],r=0,n=0;n>6|192,t[r++]=63&o|128):55296==(64512&o)&&n+1>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128)}return t},u={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[],o=0;o>2,l=(3&i)<<4|s>>4,p=(15&s)<<2|c>>6,h=63&c;u||(h=64,a||(p=64)),n.push(r[d],r[l],r[p],r[h])}return n.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],r=0,n=0;r191&&o<224){var i=e[r++];t[n++]=String.fromCharCode((31&o)<<6|63&i)}else if(o>239&&o<365){var a=((7&o)<<18|(63&(i=e[r++]))<<12|(63&(s=e[r++]))<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(a>>10)),t[n++]=String.fromCharCode(56320+(1023&a))}else{i=e[r++];var s=e[r++];t[n++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[],o=0;o>4;if(n.push(c),64!==s){var d=a<<4&240|s>>2;if(n.push(d),64!==u){var l=s<<6&192|u;n.push(l)}}}return n},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},c=function(e){try{return u.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function d(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var r in t)t.hasOwnProperty(r)&&(e[r]=d(e[r],t[r]));return e}var l=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r})}return e.prototype.wrapCallback=function(e){var t=this;return function(r,n){r?t.reject(r):t.resolve(n),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(r):e(r,n))}},e}();function p(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function h(){try{return"[object process]"===Object.prototype.toString.call(r.g.process)}catch(e){return!1}}var f=function(e){function t(r,n){var o=e.call(this,n)||this;return o.code=r,o.name="FirebaseError",Object.setPrototypeOf(o,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,g.prototype.create),o}return n.__extends(t,e),t}(Error),g=function(){function e(e,t,r){this.service=e,this.serviceName=t,this.errors=r}return e.prototype.create=function(e){for(var t=[],r=1;r"})}(0,n):"Error",s=this.serviceName+": "+a+" ("+o+").",u=new f(o,s),c=0,d=Object.keys(n);c>>31)}var i,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],d=this.chain_[3],l=this.chain_[4];for(n=0;n<80;n++)n<40?n<20?(i=d^u&(c^d),a=1518500249):(i=u^c^d,a=1859775393):n<60?(i=u&c|d&(u|c),a=2400959708):(i=u^c^d,a=3395469782),o=(s<<5|s>>>27)+i+l+a+r[n]&4294967295,l=d,d=c,c=4294967295&(u<<30|u>>>2),u=s,s=o;this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+d&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var r=t-this.blockSize,n=0,o=this.buf_,i=this.inbuf_;n=56;r--)this.buf_[r]=255&t,t/=256;this.compress_(this.buf_);var n=0;for(r=0;r<5;r++)for(var o=24;o>=0;o-=8)e[n]=this.chain_[r]>>o&255,++n;return e},e}(),b=function(){function e(e,t){var r=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(r)}).catch(function(e){r.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,r){var n,o=this;if(void 0===e&&void 0===t&&void 0===r)throw new Error("Missing Observer.");void 0===(n=function(e){if("object"!=typeof e||null===e)return!1;for(var t=0,r=["next","error","complete"];t 4. Need to update it?")}return e+" failed: "+n+" argument "}t.CONSTANTS=o,t.Deferred=l,t.ErrorFactory=g,t.FirebaseError=f,t.MAX_VALUE_MILLIS=144e5,t.RANDOM_FACTOR=.5,t.Sha1=y,t.areCookiesEnabled=function(){return!(!navigator||!navigator.cookieEnabled)},t.assert=i,t.assertionError=a,t.async=function(e,t){return function(){for(var r=[],n=0;n=0},t.isEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isIE=function(){var e=p();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},t.isIndexedDBAvailable=function(){return"indexedDB"in self&&null!=indexedDB},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())},t.isNode=h,t.isNodeSdk=function(){return!0===o.NODE_CLIENT||!0===o.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isSafari=function(){return!h()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},t.isUWP=function(){return p().indexOf("MSAppHost/")>=0},t.isValidFormat=function(e){var t=_(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t=_(e).claims,r=Math.floor((new Date).getTime()/1e3),n=0,o=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?n=t.nbf:t.hasOwnProperty("iat")&&(n=t.iat),o=t.hasOwnProperty("exp")?t.exp:n+86400),!!r&&!!n&&!!o&&r>=n&&r<=o},t.issuedAtTime=function(e){var t=_(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=v,t.map=function(e,t,r){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t.call(r,e[o],o,e));return n},t.querystring=function(e){for(var t=[],r=function(e,r){Array.isArray(r)?r.forEach(function(r){t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))},n=0,o=Object.entries(e);n=55296&&n<=56319?(t+=4,r++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],r=0,n=0;n=55296&&o<=56319){var a=o-55296;i(++n>6|192,t[r++]=63&o|128):o<65536?(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.validateArgCount=function(e,t,r,n){var o;if(nr&&(o=0===r?"none":"no more than "+r),o)throw new Error(e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+o+".")},t.validateCallback=function(e,t,r,n){if((!n||r)&&"function"!=typeof r)throw new Error(S(e,t,n)+"must be a valid function.")},t.validateContextObject=function(e,t,r,n){if((!n||r)&&("object"!=typeof r||null===r))throw new Error(S(e,t,n)+"must be a valid context object.")},t.validateIndexedDBOpenable=function(){return new Promise(function(e,t){try{var r=!0,n="validate-browser-context-for-indexeddb-analytics-module",o=window.indexedDB.open(n);o.onsuccess=function(){o.result.close(),r||window.indexedDB.deleteDatabase(n),e(!0)},o.onupgradeneeded=function(){r=!1},o.onerror=function(){var e;t((null===(e=o.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})},t.validateNamespace=function(e,t,r,n){if((!n||r)&&"string"!=typeof r)throw new Error(S(e,t,n)+"must be a valid firebase namespace.")}},577:(e,t,r)=>{"use strict";var n=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(r(199));n.default.registerVersion("firebase","7.24.0","app"),e.exports=n.default},588:function(e,t){!function(e){"use strict";function t(e){return new Promise(function(t,r){e.onsuccess=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function r(e,r,n){var o,i=new Promise(function(i,a){t(o=e[r].apply(e,n)).then(i,a)});return i.request=o,i}function n(e,t,r){r.forEach(function(r){Object.defineProperty(e.prototype,r,{get:function(){return this[t][r]},set:function(e){this[t][r]=e}})})}function o(e,t,n,o){o.forEach(function(o){o in n.prototype&&(e.prototype[o]=function(){return r(this[t],o,arguments)})})}function i(e,t,r,n){n.forEach(function(n){n in r.prototype&&(e.prototype[n]=function(){return this[t][n].apply(this[t],arguments)})})}function a(e,t,n,o){o.forEach(function(o){o in n.prototype&&(e.prototype[o]=function(){return e=this[t],(n=r(e,o,arguments)).then(function(e){if(e)return new u(e,n.request)});var e,n})})}function s(e){this._index=e}function u(e,t){this._cursor=e,this._request=t}function c(e){this._store=e}function d(e){this._tx=e,this.complete=new Promise(function(t,r){e.oncomplete=function(){t()},e.onerror=function(){r(e.error)},e.onabort=function(){r(e.error)}})}function l(e,t,r){this._db=e,this.oldVersion=t,this.transaction=new d(r)}function p(e){this._db=e}n(s,"_index",["name","keyPath","multiEntry","unique"]),o(s,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),a(s,"_index",IDBIndex,["openCursor","openKeyCursor"]),n(u,"_cursor",["direction","key","primaryKey","value"]),o(u,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(e){e in IDBCursor.prototype&&(u.prototype[e]=function(){var r=this,n=arguments;return Promise.resolve().then(function(){return r._cursor[e].apply(r._cursor,n),t(r._request).then(function(e){if(e)return new u(e,r._request)})})})}),c.prototype.createIndex=function(){return new s(this._store.createIndex.apply(this._store,arguments))},c.prototype.index=function(){return new s(this._store.index.apply(this._store,arguments))},n(c,"_store",["name","keyPath","indexNames","autoIncrement"]),o(c,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),a(c,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),i(c,"_store",IDBObjectStore,["deleteIndex"]),d.prototype.objectStore=function(){return new c(this._tx.objectStore.apply(this._tx,arguments))},n(d,"_tx",["objectStoreNames","mode"]),i(d,"_tx",IDBTransaction,["abort"]),l.prototype.createObjectStore=function(){return new c(this._db.createObjectStore.apply(this._db,arguments))},n(l,"_db",["name","version","objectStoreNames"]),i(l,"_db",IDBDatabase,["deleteObjectStore","close"]),p.prototype.transaction=function(){return new d(this._db.transaction.apply(this._db,arguments))},n(p,"_db",["name","version","objectStoreNames"]),i(p,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(e){[c,s].forEach(function(t){e in t.prototype&&(t.prototype[e.replace("open","iterate")]=function(){var t,r=(t=arguments,Array.prototype.slice.call(t)),n=r[r.length-1],o=this._store||this._index,i=o[e].apply(o,r.slice(0,-1));i.onsuccess=function(){n(i.result)}})})}),[s,c].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,t){var r=this,n=[];return new Promise(function(o){r.iterateCursor(e,function(e){e?(n.push(e.value),void 0===t||n.length!=t?e.continue():o(n)):o(n)})})})}),e.openDb=function(e,t,n){var o=r(indexedDB,"open",[e,t]),i=o.request;return i&&(i.onupgradeneeded=function(e){n&&n(new l(i.result,e.oldVersion,i.transaction))}),o.then(function(e){return new p(e)})},e.deleteDb=function(e){return r(indexedDB,"deleteDatabase",[e])},Object.defineProperty(e,"__esModule",{value:!0})}(t)},215:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>(function(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:s(e[n](t)),done:"return"===n}:o?o(t):t}:o}}),__asyncGenerator:()=>(function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||u(e,t)})})}function u(e,t){try{(r=o[e](t)).value instanceof s?Promise.resolve(r.value.v).then(c,d):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){u("next",e)}function d(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}),__asyncValues:()=>(function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=i(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,o,(t=e[r](t)).done,t.value)})}}}),__await:()=>s,__awaiter:()=>(function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})}),__classPrivateFieldGet:()=>(function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}),__classPrivateFieldSet:()=>(function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}),__createBinding:()=>(function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),__decorate:()=>(function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}),__exportStar:()=>(function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}),__extends:()=>(function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),__generator:()=>(function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1](function(e){return e&&e.__esModule?e:{default:e}}),__importStar:()=>(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}),__makeTemplateObject:()=>(function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}),__metadata:()=>(function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}),__param:()=>(function(e,t){return function(r,n){t(r,n,e)}}),__read:()=>a,__rest:()=>(function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o(function(){for(var e=[],t=0;t(function(){for(var e=0,t=0,r=arguments.length;ti});var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function s(e){return this instanceof s?(this.v=e,this):new s(e)}},633:(e,t,r)=>{var n=r(738).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new O(n||[]);return s(i,"_invoke",{value:U(e,r,a)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=h;var g="suspendedStart",m="suspendedYield",v="executing",_="completed",y={};function b(){}function w(){}function S(){}var I={};p(I,c,function(){return this});var k=Object.getPrototypeOf,E=k&&k(k(D([])));E&&E!==i&&a.call(E,c)&&(I=E);var C=S.prototype=b.prototype=Object.create(I);function T(e){["next","throw","return"].forEach(function(t){p(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){function r(o,i,s,u){var c=f(e[o],e,i);if("throw"!==c.type){var d=c.arg,l=d.value;return l&&"object"==n(l)&&a.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,s,u)},function(e){r("throw",e,s,u)}):t.resolve(l).then(function(e){d.value=e,s(d)},function(e){return r("throw",e,s,u)})}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function i(){return new t(function(t,o){r(e,n,t,o)})}return o=o?o.then(i,i):i()}})}function U(e,r,n){var o=g;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===_){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=F(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?_:m,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=_,n.method="throw",n.arg=c.arg)}}}function F(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,F(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=(e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}),r.d=((e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),r.r=(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}),(()=>{"use strict";function e(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,u,"next",t)}function u(t){e(a,o,i,s,u,"throw",t)}s(void 0)})}}var n=r(756),o=r.n(n);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return function(){return t(o().mark(function e(t){return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){"activated"===t.state?e(t):t.addEventListener("statechange",function(){"activated"===t.state&&e(t)})}));case 1:case"end":return e.stop()}},e)})).apply(this,arguments)}.apply(this,arguments)}!function(e,t){var r="http"+("https:"===t.location.protocol?"s":"")+"://",n="logglytrackingsession";function o(){this.key=!1,this.sendConsoleErrors=!1,this.tag="jslogger",this.useDomainProxy=!1,this.useUtfEncoding=!1}function a(t){1==t.useDomainProxy?t.inputUrl=r+e.location.host+"/loggly/inputs/"+t.key+"/tag/"+t.tag:t.inputUrl=r+(t.logglyCollectorDomain||"logs-01.loggly.com")+"/inputs/"+t.key+"/tag/"+t.tag}o.prototype={setSession:function(e){e?(this.session_id=e,this.setCookie(this.session_id)):this.session_id||(this.session_id=this.readCookie(),this.session_id||(this.session_id="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),this.setCookie(this.session_id)))},push:function(t){var r=i(t);if(t&&("object"===r||"string"===r)){var n,o,s,u,c,d,l,p,h=this;if("string"===r)t={text:t};else{if(t.logglyCollectorDomain)return void(h.logglyCollectorDomain=t.logglyCollectorDomain);if(void 0!==t.sendConsoleErrors&&function(t,r){if(t.sendConsoleErrors=r,!0===t.sendConsoleErrors){var n=e.onerror;e.onerror=function(r,o,i,a,s){t.push({category:"BrowserJsException",exception:{message:r,url:o,lineno:i,colno:a,stack:s?s.stack:"n/a"}}),n&&"function"==typeof n&&n.apply(e,arguments)}}}(h,t.sendConsoleErrors),t.tag&&(l=h,p=t.tag,l.tag=p),void 0!==t.useUtfEncoding&&(c=h,d=t.useUtfEncoding,c.useUtfEncoding=d),t.useDomainProxy&&(s=h,u=t.useDomainProxy,s.useDomainProxy=u,a(s)),t.logglyKey)return n=h,o=t.logglyKey,n.key=o,n.setSession(),void a(n);if(t.session_id)return void h.setSession(t.session_id)}h.key&&h.track(t)}},track:function(t){t.sessionId=this.session_id;try{var r=new XMLHttpRequest;r.open("POST",this.inputUrl,!0),!0===u.useUtfEncoding?r.setRequestHeader("Content-Type","text/plain; charset=utf-8"):r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(t))}catch(r){e&&e.console&&"function"==typeof e.console.log&&(console.log("Failed to log to loggly because of this exception:\n"+r),console.log("Failed log data:",t))}},readCookie:function(){var e=t.cookie,r=e.indexOf(n);if(r<0)return!1;var o=e.indexOf(";",r+1);return o=o<0?e.length:o,e.slice(r+22,o)},setCookie:function(e){t.cookie=n+"="+e}};var s=e._LTracker,u=new o;if(s&&s.length){var c=0,d=s.length;for(c=0;c=500&&t.status<600?[2,e()]:[2,t]}})})}function F(e){return new Promise(function(t){setTimeout(t,e)})}var P=/^[cdef][\w-]{21}$/,A="";function O(e){return e.appName+"!"+e.appId}var D=new Map;function N(e,t){var r=O(e);H(r,t),function(e,t){var r=R();r&&r.postMessage({key:e,fid:t}),j()}(r,t)}function H(e,t){var r,n,o=D.get(e);if(o)try{for(var i=(0,h.__values)(o),a=i.next();!a.done;a=i.next())(0,a.value)(t)}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}var L=null;function R(){return!L&&"BroadcastChannel"in self&&((L=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(e){H(e.data.key,e.data.fid)}),L}function j(){0===D.size&&L&&(L.close(),L=null)}var B,M,W="firebase-installations-database",V=1,q="firebase-installations-store",K=null;function z(){return K||(K=(0,g.openDb)(W,V,function(e){0===e.oldVersion&&e.createObjectStore(q)})),K}function G(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a;return(0,h.__generator)(this,function(s){switch(s.label){case 0:return r=O(e),[4,z()];case 1:return n=s.sent(),o=n.transaction(q,"readwrite"),[4,(i=o.objectStore(q)).get(r)];case 2:return a=s.sent(),[4,i.put(t,r)];case 3:return s.sent(),[4,o.complete];case 4:return s.sent(),a&&a.fid===t.fid||N(e,t.fid),[2,t]}})})}function $(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return t=O(e),[4,z()];case 1:return r=o.sent(),[4,(n=r.transaction(q,"readwrite")).objectStore(q).delete(t)];case 2:return o.sent(),[4,n.complete];case 3:return o.sent(),[2]}})})}function J(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return r=O(e),[4,z()];case 1:return n=u.sent(),o=n.transaction(q,"readwrite"),[4,(i=o.objectStore(q)).get(r)];case 2:return a=u.sent(),void 0!==(s=t(a))?[3,4]:[4,i.delete(r)];case 3:return u.sent(),[3,6];case 4:return[4,i.put(s,r)];case 5:u.sent(),u.label=6;case 6:return[4,o.complete];case 7:return u.sent(),!s||a&&a.fid===s.fid||N(e,s.fid),[2,s]}})})}function X(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,J(e,function(r){var n=Z(r||{fid:function(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;var t=function(e){var t;return(t=e,btoa(String.fromCharCode.apply(String,(0,h.__spread)(t))).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22)}(e);return P.test(t)?t:A}catch(e){return A}}(),registrationStatus:0}),o=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(S.create("app-offline"))};var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,7]),[4,function(e,t){var r=t.fid;return(0,h.__awaiter)(this,void 0,void 0,function(){var t,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return t=k(e),n=T(e),o={fid:r,authVersion:y,appId:e.appId,sdkVersion:_},i={method:"POST",headers:n,body:JSON.stringify(o)},[4,U(function(){return fetch(t,i)})];case 1:return(a=u.sent()).ok?[4,a.json()]:[3,3];case 2:return[2,{fid:(s=u.sent()).fid||r,registrationStatus:2,refreshToken:s.refreshToken,authToken:E(s.authToken)}];case 3:return[4,C("Create Installation",a)];case 4:throw u.sent()}})})}(e,t)];case 1:return r=o.sent(),[2,G(e,r)];case 2:return I(n=o.sent())&&409===n.serverCode?[4,$(e)]:[3,4];case 3:return o.sent(),[3,6];case 4:return[4,G(e,{fid:t.fid,registrationStatus:0})];case 5:o.sent(),o.label=6;case 6:throw n;case 7:return[2]}})})}(e,r);return{installationEntry:r,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return[4,Y(e)];case 1:t=i.sent(),i.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,F(100)];case 3:return i.sent(),[4,Y(e)];case 4:return t=i.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,X(e)];case 6:return r=i.sent(),n=r.installationEntry,(o=r.registrationPromise)?[2,o]:[2,n];case 7:return[2,t]}})})}(e)}:{installationEntry:t}}(e,n);return t=o.registrationPromise,o.installationEntry})];case 1:return(r=o.sent()).fid!==A?[3,3]:(n={},[4,t]);case 2:return[2,(n.installationEntry=o.sent(),n)];case 3:return[2,{installationEntry:r,registrationPromise:t}]}})})}function Y(e){return J(e,function(e){if(!e)throw S.create("installation-not-found");return Z(e)})}function Z(e){return 1===(t=e).registrationStatus&&t.registrationTime+v0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null]}})})}(e.appConfig.senderId)];case 4:return(n=o.sent())?[4,be(e,n)]:[3,6];case 5:return o.sent(),[2,n];case 6:return[2]}})})}function be(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return r=we(e),[4,_e()];case 1:return n=i.sent(),[4,(o=n.transaction(me,"readwrite")).objectStore(me).put(t,r)];case 2:return i.sent(),[4,o.complete];case 3:return i.sent(),[2,t]}})})}function we(e){return e.appConfig.appId}function Se(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a;return(0,h.__generator)(this,function(s){switch(s.label){case 0:return[4,ke(e)];case 1:r=s.sent(),n={method:"DELETE",headers:r},s.label=2;case 2:return s.trys.push([2,5,,6]),[4,fetch(Ie(e.appConfig)+"/"+t,n)];case 3:return[4,s.sent().json()];case 4:if((o=s.sent()).error)throw i=o.error.message,ie.create("token-unsubscribe-failed",{errorInfo:i});return[3,6];case 5:throw a=s.sent(),ie.create("token-unsubscribe-failed",{errorInfo:a});case 6:return[2]}})})}function Ie(e){var t=e.projectId;return se+"/projects/"+t+"/registrations"}function ke(e){var t=e.appConfig,r=e.installations;return(0,h.__awaiter)(this,void 0,void 0,function(){var e;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return[4,r.getToken()];case 1:return e=n.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t.apiKey,"x-goog-firebase-installations-auth":"FIS "+e})]}})})}function Ee(e){var t=e.p256dh,r=e.auth,n=e.endpoint,o=e.vapidKey,i={web:{endpoint:n,auth:r,p256dh:t}};return o!==ae&&(i.web.applicationPubKey=o),i}function Ce(e,t,r){return(0,h.__awaiter)(this,void 0,void 0,function(){var n,o,i,a;return(0,h.__generator)(this,function(s){switch(s.label){case 0:if("granted"!==Notification.permission)throw ie.create("permission-blocked");return[4,function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return[4,e.pushManager.getSubscription()];case 1:return(r=n.sent())?[2,r]:[2,e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length),o=0;o=o.createTime+6048e5?[2,function(e,t,r){return(0,h.__awaiter)(this,void 0,void 0,function(){var n,o,i;return(0,h.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,5]),[4,function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return[4,ke(e)];case 1:r=u.sent(),n=Ee(t.subscriptionOptions),o={method:"PATCH",headers:r,body:JSON.stringify(n)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(Ie(e.appConfig)+"/"+t.token,o)];case 3:return[4,u.sent().json()];case 4:return i=u.sent(),[3,6];case 5:throw a=u.sent(),ie.create("token-update-failed",{errorInfo:a});case 6:if(i.error)throw s=i.error.message,ie.create("token-update-failed",{errorInfo:s});if(!i.token)throw ie.create("token-update-no-token");return[2,i.token]}})})}(t,e)];case 1:return n=a.sent(),o=(0,h.__assign)((0,h.__assign)({},e),{token:n,createTime:Date.now()}),[4,be(t,o)];case 2:return a.sent(),[2,n];case 3:return i=a.sent(),[4,Te(t,r)];case 4:throw a.sent(),i;case 5:return[2]}})})}({token:o.token,createTime:Date.now(),subscriptionOptions:i},e,t)]:[2,o.token];case 9:return[2]}var u,c,d,l,p,f})})}function Te(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,ye(e)];case 1:return(r=o.sent())?[4,Se(e,r.token)]:[3,4];case 2:return o.sent(),[4,function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return t=we(e),[4,_e()];case 1:return r=o.sent(),[4,(n=r.transaction(me,"readwrite")).objectStore(me).delete(t)];case 2:return o.sent(),[4,n.complete];case 3:return o.sent(),[2]}})})}(e)];case 3:o.sent(),o.label=4;case 4:return[4,t.pushManager.getSubscription()];case 5:return(n=o.sent())?[2,n.unsubscribe()]:[2,!0]}})})}function xe(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return[4,ke(e)];case 1:r=u.sent(),n=Ee(t),o={method:"POST",headers:r,body:JSON.stringify(n)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(Ie(e.appConfig),o)];case 3:return[4,u.sent().json()];case 4:return i=u.sent(),[3,6];case 5:throw a=u.sent(),ie.create("token-subscribe-failed",{errorInfo:a});case 6:if(i.error)throw s=i.error.message,ie.create("token-subscribe-failed",{errorInfo:s});if(!i.token)throw ie.create("token-subscribe-no-token");return[2,i.token]}})})}(e,t)];case 1:return r=o.sent(),n={token:r,createTime:Date.now(),subscriptionOptions:t},[4,be(e,n)];case 2:return o.sent(),[2,n.token]}})})}function Ue(e){return"object"==typeof e&&!!e&&ce in e}var Fe=function(){function e(e){var t=this;this.firebaseDependencies=e,this.isOnBackgroundMessageUsed=null,this.vapidKey=null,this.bgMessageHandler=null,self.addEventListener("push",function(e){e.waitUntil(t.onPush(e))}),self.addEventListener("pushsubscriptionchange",function(e){e.waitUntil(t.onSubChange(e))}),self.addEventListener("notificationclick",function(e){e.waitUntil(t.onNotificationClick(e))})}return Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.setBackgroundMessageHandler=function(e){if(this.isOnBackgroundMessageUsed=!1,!e||"function"!=typeof e)throw ie.create("invalid-bg-handler");this.bgMessageHandler=e},e.prototype.onBackgroundMessage=function(e){var t=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=e,function(){t.bgMessageHandler=null}},e.prototype.getToken=function(){var e,t;return(0,h.__awaiter)(this,void 0,void 0,function(){var r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return this.vapidKey?[3,2]:[4,ye(this.firebaseDependencies)];case 1:r=n.sent(),this.vapidKey=null!==(t=null===(e=null==r?void 0:r.subscriptionOptions)||void 0===e?void 0:e.vapidKey)&&void 0!==t?t:ae,n.label=2;case 2:return[2,Ce(this.firebaseDependencies,self.registration,this.vapidKey)]}})})},e.prototype.deleteToken=function(){return Te(this.firebaseDependencies,self.registration)},e.prototype.requestPermission=function(){throw ie.create("only-available-in-window")},e.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw ie.create("use-vapid-key-after-get-token");if("string"!=typeof e||0===e.length)throw ie.create("invalid-vapid-key");this.vapidKey=e},e.prototype.useServiceWorker=function(){throw ie.create("only-available-in-window")},e.prototype.onMessage=function(){throw ie.create("only-available-in-window")},e.prototype.onTokenRefresh=function(){throw ie.create("only-available-in-window")},e.prototype.onPush=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return(t=function(e){var t=e.data;if(!t)return null;try{return t.json()}catch(e){return null}}(e))?[4,Pe()]:(console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return(r=i.sent()).some(function(e){return"visible"===e.visibilityState&&!e.url.startsWith("chrome-extension://")})?[2,function(e,t){var r,n;t.isFirebaseMessaging=!0,t.messageType=ne.PUSH_RECEIVED;try{for(var o=(0,h.__values)(e),i=o.next();!i.done;i=o.next())i.value.postMessage(t)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}(r,t)]:(n=!1,t.notification?[4,function(e){var t,r=e.actions,n=Notification.maxActions;return r&&n&&r.length>n&&console.warn("This browser only supports "+n+" actions. The remaining actions will not be displayed."),self.registration.showNotification(null!==(t=e.title)&&void 0!==t?t:"",e)}(function(e){var t,r=(0,h.__assign)({},e.notification);return r.data=((t={})[ue]=e,t),r}(t))]:[3,3]);case 2:i.sent(),n=!0,i.label=3;case 3:return!0===n&&!1===this.isOnBackgroundMessageUsed||this.bgMessageHandler&&(o=function(e){var t={from:e.from,collapseKey:e.collapse_key};return function(e,t){if(t.notification){e.notification={};var r=t.notification.title;r&&(e.notification.title=r);var n=t.notification.body;n&&(e.notification.body=n);var o=t.notification.image;o&&(e.notification.image=o)}}(t,e),function(e,t){t.data&&(e.data=t.data)}(t,e),function(e,t){if(t.fcmOptions){e.fcmOptions={};var r=t.fcmOptions.link;r&&(e.fcmOptions.link=r);var n=t.fcmOptions.analytics_label;n&&(e.fcmOptions.analyticsLabel=n)}}(t,e),t}(t),"function"==typeof this.bgMessageHandler?this.bgMessageHandler(o):this.bgMessageHandler.next(o)),[2]}})})},e.prototype.onSubChange=function(e){var t,r;return(0,h.__awaiter)(this,void 0,void 0,function(){var n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return e.newSubscription?[3,2]:[4,Te(this.firebaseDependencies,self.registration)];case 1:case 5:return o.sent(),[2];case 2:return[4,ye(this.firebaseDependencies)];case 3:return n=o.sent(),[4,Te(this.firebaseDependencies,self.registration)];case 4:return o.sent(),[4,Ce(this.firebaseDependencies,self.registration,null!==(r=null===(t=null==n?void 0:n.subscriptionOptions)||void 0===t?void 0:t.vapidKey)&&void 0!==r?r:ae)]}})})},e.prototype.onNotificationClick=function(e){var t,r;return(0,h.__awaiter)(this,void 0,void 0,function(){var n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return(n=null===(r=null===(t=e.notification)||void 0===t?void 0:t.data)||void 0===r?void 0:r[ue])?e.action?[2]:(e.stopImmediatePropagation(),e.notification.close(),(o=function(e){var t,r,n;return(null!==(r=null===(t=e.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==r?r:null===(n=e.notification)||void 0===n?void 0:n.click_action)||(Ue(e.data)?self.location.origin:null)}(n))?(i=new URL(o,self.location.href),a=new URL(self.location.origin),i.host!==a.host?[2]:[4,function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return[4,Pe()];case 1:t=u.sent();try{for(r=(0,h.__values)(t),n=r.next();!n.done;n=r.next())if(o=n.value,i=new URL(o.url,self.location.href),e.host===i.host)return[2,o]}catch(e){a={error:e}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}return[2,null]}})})}(i)]):[2]):[2];case 1:return(s=u.sent())?[3,4]:[4,self.clients.openWindow(o)];case 2:return s=u.sent(),[4,new Promise(function(e){setTimeout(e,3e3)})];case 3:return u.sent(),[3,6];case 4:return[4,s.focus()];case 5:s=u.sent(),u.label=6;case 6:return s?(n.messageType=ne.NOTIFICATION_CLICKED,n.isFirebaseMessaging=!0,[2,s.postMessage(n)]):[2]}})})},e}();function Pe(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}var Ae=function(){function e(e){var t=this;this.firebaseDependencies=e,this.vapidKey=null,this.onMessageCallback=null,navigator.serviceWorker.addEventListener("message",function(e){return t.messageEventListener(e)})}return Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.messageEventListener=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return(t=e.data).isFirebaseMessaging?(this.onMessageCallback&&t.messageType===ne.PUSH_RECEIVED&&("function"==typeof this.onMessageCallback?this.onMessageCallback(function(e){return delete e.messageType,delete e.isFirebaseMessaging,e}(Object.assign({},t))):this.onMessageCallback.next(Object.assign({},t))),Ue(r=t.data)&&"1"===r["google.c.a.e"]?[4,this.logEvent(t.messageType,r)]:[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.getVapidKey=function(){return this.vapidKey},e.prototype.getSwReg=function(){return this.swRegistration},e.prototype.getToken=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(t){switch(t.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:t.sent(),t.label=2;case 2:if("granted"!==Notification.permission)throw ie.create("permission-blocked");return[4,this.updateVapidKey(null==e?void 0:e.vapidKey)];case 3:return t.sent(),[4,this.updateSwReg(null==e?void 0:e.serviceWorkerRegistration)];case 4:return t.sent(),[2,Ce(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}})})},e.prototype.updateVapidKey=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(t){return e?this.vapidKey=e:this.vapidKey||(this.vapidKey=ae),[2]})})},e.prototype.updateSwReg=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(t){switch(t.label){case 0:return e||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:t.sent(),t.label=2;case 2:if(!e&&this.swRegistration)return[2];if(!(e instanceof ServiceWorkerRegistration))throw ie.create("invalid-sw-registration");return this.swRegistration=e,[2]}})})},e.prototype.registerDefaultSw=function(){return(0,h.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,h.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 1:return e.swRegistration=r.sent(),this.swRegistration.update().catch(function(){}),[3,3];case 2:throw t=r.sent(),ie.create("failed-service-worker-registration",{browserErrorMessage:t.message});case 3:return[2]}})})},e.prototype.deleteToken=function(){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(e){switch(e.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:e.sent(),e.label=2;case 2:return[2,Te(this.firebaseDependencies,this.swRegistration)]}})})},e.prototype.requestPermission=function(){return(0,h.__awaiter)(this,void 0,void 0,function(){var e;return(0,h.__generator)(this,function(t){switch(t.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(e=t.sent()))return[2];throw"denied"===e?ie.create("permission-blocked"):ie.create("permission-default")}})})},e.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw ie.create("use-vapid-key-after-get-token");if("string"!=typeof e||0===e.length)throw ie.create("invalid-vapid-key");this.vapidKey=e},e.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw ie.create("invalid-sw-registration");if(this.swRegistration)throw ie.create("use-sw-after-get-token");this.swRegistration=e},e.prototype.onMessage=function(e){var t=this;return this.onMessageCallback=e,function(){t.onMessageCallback=null}},e.prototype.setBackgroundMessageHandler=function(){throw ie.create("only-available-in-sw")},e.prototype.onBackgroundMessage=function(){throw ie.create("only-available-in-sw")},e.prototype.onTokenRefresh=function(){return function(){}},e.prototype.logEvent=function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return r=function(e){switch(e){case ne.NOTIFICATION_CLICKED:return"notification_open";case ne.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(e),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return n.sent().logEvent(r,{message_id:t[ce],message_name:t["google.c.a.c_l"],message_time:t["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}})})},e}();function Oe(e){return ie.create("missing-app-config-values",{valueName:e})}var De={isSupported:Ne};function Ne(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}l.default.INTERNAL.registerComponent(new p.Component("messaging",function(e){var t=e.getProvider("app").getImmediate(),r=function(e){var t,r;if(!e||!e.options)throw Oe("App Configuration Object");if(!e.name)throw Oe("App Name");var n=e.options;try{for(var o=(0,h.__values)(["projectId","apiKey","appId","messagingSenderId"]),i=o.next();!i.done;i=o.next()){var a=i.value;if(!n[a])throw Oe(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}(t),n={app:t,appConfig:r,installations:e.getProvider("installations").getImmediate(),analyticsProvider:e.getProvider("analytics-internal")};if(!Ne())throw ie.create("unsupported-browser");return self&&"ServiceWorkerGlobalScope"in self?new Fe(n):new Ae(n)},"PUBLIC").setServiceProps(De));var He=function(){var e=d().initializeApp({apiKey:"AIzaSyAv7G04oyBZYqE_yAyku-rRQRXnsA1mLmw",authDomain:"webpush-prod.firebaseapp.com",projectId:"webpush-prod",storageBucket:"webpush-prod.appspot.com",messagingSenderId:"312459295826",appId:"1:312459295826:web:6d6650a797358aafe3f38b",measurementId:"G-FWD9J8MWD6"},"pushMessage").messaging();return e.usePublicVapidKey("BAdGdYm_SSlWJV0eXw36DDjDPhKYsa37R5WphjCA_Dm1kBo55XsVCn62jCE1RFAAXbzQGs0mG3hs9ZvXhVfTUpg"),e},Le=function(){var e=t(o().mark(function e(t,r){var n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getToken({vapidKey:"BAdGdYm_SSlWJV0eXw36DDjDPhKYsa37R5WphjCA_Dm1kBo55XsVCn62jCE1RFAAXbzQGs0mG3hs9ZvXhVfTUpg",serviceWorkerRegistration:r});case 3:n=e.sent,e.next=9;break;case 6:return e.next=8,t.getToken();case 8:n=e.sent;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}();const Re=function(){var e=t(o().mark(function e(){var t,r,n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s("/doppler-push-notification-sw.js");case 2:if(!(t=e.sent)){e.next=20;break}return e.prev=4,e.next=7,t.pushManager.getSubscription();case 7:if(n=e.sent){e.next=14;break}return e.next=11,t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:"BBBe2B9PLkV30W5fRnY8E6jtuWZQJzxY5933G2XyVucFOX6ozAZfRRrPNi9iFY6CE0JFvXzIZL5s81jKsV7mVjI"});case 11:r=e.sent,e.next=15;break;case 14:r=n;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(4),console.log("Fail subscribing to Doppler notifications. Error: ".concat(JSON.stringify(e.t0)));case 20:return e.abrupt("return",r?r.toJSON():null);case 21:case"end":return e.stop()}},e,null,[[4,17]])}));return function(){return e.apply(this,arguments)}}();function je(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function Be(e,t){for(var r=0;r